#include "pch.h"
#include "MyEllipse.h"


IMPLEMENT_SERIAL(MyEllipse, CGraph, 1)


MyEllipse::MyEllipse()
{
}

MyEllipse::MyEllipse(int DrawType, CPoint ptCenter, UINT OffsetDistance) :CGraph(DrawType, ptCenter, OffsetDistance) {

}

void MyEllipse::Draw(CDC* pDC)
{
	pDC->Ellipse(CRect(m_ptCenter.x - m_iOffsetDistance, m_ptCenter.y - m_iOffsetDistance, m_ptCenter.x + m_iOffsetDistance, m_ptCenter.y + m_iOffsetDistance));
}

void MyEllipse::Move(int x, int y)
{
	m_ptCenter.x += x;
	m_ptCenter.y += y;
}

void MyEllipse::Serialize(CArchive& ar)
{
	CGraph::Serialize(ar);

	if (ar.IsStoring())
		ar << m_iDrawType << m_ptCenter << m_iOffsetDistance;
	else
		ar >> m_iDrawType >> m_ptCenter >> m_iOffsetDistance;
}
